#@adminLayout()
#define main()
  <main class="app-content">
    <div class="app-title">
      <div>
        <h1><i class="fa fa-th-list"></i>文章管理</h1>
        <p>网站文章管理</p>
      </div>
      <ul class="app-breadcrumb breadcrumb">
        <li class="breadcrumb-item"><a href="/admin"><i class="fa fa-home fa-lg"></i>仪表盘</a></li>
        <li class="breadcrumb-item active"><a href="/admin/article">文章管理</a></li>
      </ul>
    </div>

	<div class="row">
		<div class="col-md-4">
          <div class="tile">
            <h3 class="tile-title">添加修改分类</h3>
            <div class="tile-body">
              <form method="post" action="/admin/comments/commentsAdd" enctype="multipart/form-data"
              >
              	<input type="hidden" name="tid" id="tid" readonly/>
                <div class="form-group">
                  <label class="control-label">分类名称</label>
                  <input class="form-control" type="text" placeholder="请输入分类名称" name="name" id="name" required="required">
                </div>
                <div class="form-group">
                  <label class="control-label">分类排序</label>
                  <input class="form-control" type="text" placeholder="分类排序,例0,1,3..." name="sort" id="sort" required="required">
                </div>
                <div class="form-group">
                  <label class="control-label">分类介绍</label>
                  <textarea class="form-control" rows="4" placeholder="请输入分类介绍" name="remarks" id="remarks" required="required"></textarea>
                </div>
              </form>
            </div>
            <div class="tile-footer">
              <a class="btn btn-primary" href="javascript:;" onclick="commentdSave();"><i class="fa fa-fw fa-lg fa-check-circle"></i>提交</a>
              <p><font id="errorInfo" color="red"></font></p>
            </div>
          </div>
        </div>
        
		<div class="col-md-8">
          <div class="tile">
            <h3 class="tile-title">分类列表</h3>
            <table class="table table-striped">
              <thead>
                <tr>
                  <th>分类名称</th>
                  <th>添加时间</th>
                  <th>分类排序</th>
                  <th>收藏情况</th>
                  <th>操作</th>
                </tr>
              </thead>
              <tbody>
              #for(x : commentsPage.getList())
                <tr>
                  <td>#(x.name)</td>
                  <td>#date(x.addtime, "yyyy-MM-dd")</td>
                  <td>#(x.sort)</td>
                  <td>#(x.favoriteCount)</td>
                  <td>
                  	#permission("/admin/comments/commentsEdit")
                  	<a class="btn btn-info btn-sm" href="javascript:;" onclick="commentsEdit(#(x.tid));" title="修改"><i class="fa fa-lg fa-edit">修改</i></a>
                    #end
                    #permission("/admin/comments/commentsDelete")
                    <a class="btn btn-danger btn-sm" href="javascript:;" onclick="confirmDelete('删除后无法恢复，确定要删除？', '/admin/comments/commentsDelete?tid=#(x.tid)');" title="删除"><i class="fa fa-lg fa-trash">删除</i></a>
                  	#end
                  </td>
                </tr>
                #end
              </tbody>
            </table>
            <div>
               #@adminPaginate(commentsPage.pageNumber, commentsPage.totalPage, "/admin/comments?p=") 
            </div>
          </div>
        </div>
      </div>
  </main>
#end